page.tsx 577 B

1234567891011121314151617181920
  1. import { fetchJson } from '@/lib/utils/server';
  2. import { ResultDto } from '@/types/response/common';
  3. import { ChannelDetail } from '@/types/channel';
  4. import { notFound } from 'next/navigation';
  5. import WatchView from './WatchView';
  6. type Props = {
  7. params: Promise<{ channelSID: string }>;
  8. };
  9. export default async function WatchPage({ params }: Props) {
  10. const { channelSID } = await params;
  11. const res: ResultDto<ChannelDetail> = await fetchJson(`/api/channel/${channelSID}`, { method: 'GET' });
  12. if (!res.data) {
  13. notFound();
  14. }
  15. return <WatchView channel={res.data} />;
  16. }